package com.liangzhong.modules.user.command
{
	import com.common.utils.Debug;
	import com.liangzhong.constants.ApplicationConstants;
	import com.liangzhong.constants.NotificationConstants;
	import com.liangzhong.lazy.GetBagInfoCmd;
	import com.liangzhong.lazy.GetMailListCmd;
	import com.liangzhong.model.AppData;
	import com.liangzhong.proxy.user.UserProxy;
	import com.lz.football.module.framework.AsyncCommand;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;

	/**
	 *用户模块 controller 
	 * @author lxh
	 * 
	 */	
	public class UserCommand extends SimpleCommand
	{
		public function UserCommand()
		{
			super();
		}
		override public function execute(notification:INotification):void
		{
			var userProxy :UserProxy = facade.retrieveProxy(UserProxy.ProxyName) as UserProxy;
			var userId :int = AppData.getInstance().user.uid;
			var userKey :String = AppData.getInstance().user.key;
			switch(notification.getName())
			{
				case ApplicationConstants.User_getUserInfo://获取用户相信信息请求
				{
					userProxy.requestUserInfo();
					break;
				}
				case UserProxy.GetUserInfo_Result://获取用户信息返回
				{
					
					break;
				}
				case ApplicationConstants.Main_Get_User_Base_Info://获取用户相关信息
				{
					//获取俱乐部信息
					this.sendNotification(ApplicationConstants.User_getUserInfo);
					//获取背包信息
					//获取邮件信息
					//获取联赛信息
					//获取签到信息
					//获取12宫信息
					var delayTime :Number = .2;
					var asyncCmd :AsyncCommand = new AsyncCommand(delayTime,
						new GetBagInfoCmd(delayTime),
						new GetMailListCmd(delayTime));
					asyncCmd.start();
					break;
				}
			}
		}
	}
}